
class GetUploadKeyModel {
  String? bucket;
  int? expires;
  String? uploadUrl;
  String? method;
  RequiredHeaders? requiredHeaders;
  String? cdn;
  String? key;

  GetUploadKeyModel({this.bucket, this.expires, this.uploadUrl, this.method, this.requiredHeaders, this.cdn, this.key});

  GetUploadKeyModel.fromJson(Map<String, dynamic> json) {
    bucket = json["bucket"];
    expires = json["expires"];
    uploadUrl = json["uploadUrl"];
    method = json["method"];
    requiredHeaders = json["requiredHeaders"] == null ? null : RequiredHeaders.fromJson(json["requiredHeaders"]);
    cdn = json["cdn"];
    key = json["key"];
  }

  static List<GetUploadKeyModel> fromList(List<Map<String, dynamic>> list) {
    return list.map(GetUploadKeyModel.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    _data["bucket"] = bucket;
    _data["expires"] = expires;
    _data["uploadUrl"] = uploadUrl;
    _data["method"] = method;
    if(requiredHeaders != null) {
      _data["requiredHeaders"] = requiredHeaders?.toJson();
    }
    _data["cdn"] = cdn;
    _data["key"] = key;
    return _data;
  }

  GetUploadKeyModel copyWith({
    String? bucket,
    int? expires,
    String? uploadUrl,
    String? method,
    RequiredHeaders? requiredHeaders,
    String? cdn,
    String? key,
  }) => GetUploadKeyModel(
    bucket: bucket ?? this.bucket,
    expires: expires ?? this.expires,
    uploadUrl: uploadUrl ?? this.uploadUrl,
    method: method ?? this.method,
    requiredHeaders: requiredHeaders ?? this.requiredHeaders,
    cdn: cdn ?? this.cdn,
    key: key ?? this.key,
  );
}

class RequiredHeaders {
  String? contentType;

  RequiredHeaders({this.contentType});

  RequiredHeaders.fromJson(Map<String, dynamic> json) {
    contentType = json["Content-Type"];
  }

  static List<RequiredHeaders> fromList(List<Map<String, dynamic>> list) {
    return list.map(RequiredHeaders.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    _data["Content-Type"] = contentType;
    return _data;
  }

  RequiredHeaders copyWith({
    String? contentType,
  }) => RequiredHeaders(
    contentType: contentType ?? this.contentType,
  );
}